dd=[]
nn1={}
ll=[]
with open('地区.txt',encoding='utf8') as f:
    for i in f.readlines():
        
        v=i.split(' ')
        ll.append(v[0])
        nn1[v[0]]=v[1]
one=''
two=''
three=''
nn=False
xx={}
ones=[]
threes={}
twos={}
for i in ll:
    if i.endswith('0000'):
        
        xx[i]={}
        one=i
        ones.append(i)
        twos[one]=[]
        nn=False
    elif i.endswith('00'):
        xx[one][i]=[]
        two=i
        nn=True
        threes[two]=[]
        twos[one].append(i)
    else:
        if nn:
            three=i
        else:
            xx[one][one]=[]
            nn=True
            two=one
            three=i
            threes[two]=[]
            twos[one].append(one)
        threes[two].append(i)
        xx[one][two].append(three)
# print(ones)
# onss=[]
# for i in ones:
#     onss.append(nn1[i])
# print(onss)
# print(threes)
print(twos)

# a=['北京市', '天津市', '河北省', '山西省', '内蒙古自治区', '辽宁省', '吉林省', '黑龙江省', '上海市', '江苏省', '浙江省', '安徽省', '福建省', '江西省', '山东省', '河南省', '湖北省', '湖南省', 
# '广东省', '广西壮族自治区', '海南省', '重庆市', '四川省', '贵州省', '云南省', '西藏自治区', '陕西省', '甘肃省', '青海省', '宁夏回族自治区', '新疆维吾尔自治区']
# ss=''
# aa=['110000', '120000', '130000', '140000', '150000', '210000', '220000', '230000', '310000', '320000', '330000', '340000', '350000', '360000', '370000', '410000', '420000', '430000', '440000', '450000', '460000', '500000', '510000', '520000', '530000', '540000', '610000', '620000', '630000', '640000', '650000']
# for i in range(len(a)):
#     ss+=f'<option value="{aa[i]}">{a[i]}</option>'
# print(ss)
        





        
        
